import { createApp } from 'vue'
import { createPinia } from 'pinia'

//ElementPlus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

//全局事件总线
import eventBus from 'vue3-eventbus'


import App from './App.vue'
import router from './router'

//vuex
import store from './stores'

//
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

//css
import './assets/main.css'
//axios
import request from './utils/request'
//echarts
import * as echarts from 'echarts';

const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }

  // request
app.config.globalProperties.request = request
  // echart
  app.config.globalProperties.echarts = echarts


app.use(createPinia())
app.use(router)
app.use(ElementPlus,{ size: 'small', zIndex: 3000 })
app.use(store)
app.use(eventBus)



app.mount('#app')
